import React from 'react';

import DatasourceTable from '../../../components/DatasourceTabel'
import usePublic from '../public';

export default function Vector() {
  const {pagination,onSearch,sortChange,tableData,pageChange} = usePublic('0103')

  const connectRender = (_,row) => {
    switch (row.fileSource) {
      case 'SMBstore':
        return JSON.parse(row.config).path;
      case 'objectstore':
        return JSON.parse(row.config).bucketName;
      default:
        return row.config;
    }
  }

  return (
    <DatasourceTable
      pagination={pagination}
      onSearch={onSearch}
      sortChange={sortChange}
      tableData={tableData}
      pageChange={pageChange}
      connectRender={connectRender}
    ></DatasourceTable>
  );
}

